KFbxSystemUnit Class Reference

#include <kfbxsystemunit.h>

List of all members.


Detailed Description

This class describes the units of measurement used within a particular scene.

Definition at line 57 of file kfbxsystemunit.h.


Public Member Functions

  KFbxSystemUnit (double pScaleFactor, double pMultiplier=1.0)
  Constructor.
  ~KFbxSystemUnit ()
  Destructor.
void  ConvertScene (KFbxScene *pScene, const KFbxUnitConversionOptions &pOptions=DefaultConversionOptions) const
  Converts a scene from its system units to this system unit.
void  ConvertChildren (KFbxNode *pRoot, const KFbxSystemUnit &pSrcUnit, const KFbxUnitConversionOptions &pOptions=DefaultConversionOptions) const
  Converts the child (or children) of the given node from the system unit to this system unit.
void  ConvertScene (KFbxScene *pScene, KFbxNode *pFbxRoot, const KFbxUnitConversionOptions &pOptions=DefaultConversionOptions) const
  Converts a scene from its system unit to this system unit, using the specified Fbx_Root node.
double  GetScaleFactor () const
  Returns the system unit's scale factor, relative to centimeters.
KString  GetScaleFactorAsString (bool pAbbreviated=true) const
  Returns a unit label for the current scale factor.
KString  GetScaleFactorAsString_Plurial () const
  Returns a unit label for the current scale factor.
double  GetMultiplier () const
  Returns the multiplier factor of the system unit.
bool  operator== (const KFbxSystemUnit &pOther) const
  Equivalence operator.
bool  operator!= (const KFbxSystemUnit &pOther) const
  Non-equivalence operator.
double  GetConversionFactorTo (const KFbxSystemUnit &pTarget) const
  Returns the conversion factor from this system unit to the target system unit, excluding the multiplier factor.
double  GetConversionFactorFrom (const KFbxSystemUnit &pSource) const
  Returns the conversion factor from the source system unit to this system unit, excluding the multiplier factor.

Static Public Attributes

static const KFbxSystemUnit  mm
  Predefined system unit for millimeters.
static const KFbxSystemUnit  dm
  Predefined system unit for decimeters.
static const KFbxSystemUnit  cm
  Predefined system unit for centimeters.
static const KFbxSystemUnit  m
  Predefined system unit for meters.
static const KFbxSystemUnit  km
  Predefined system unit for kilometers.
static const KFbxSystemUnit  Inch
  Predefined system unit for inches.
static const KFbxSystemUnit  Foot
  Predefined system unit for feet.
static const KFbxSystemUnit  Mile
  Predefined system unit for miles.
static const KFbxSystemUnit  Yard
  Predefined system unit for yards.
static const KFbxSystemUnit sPredefinedUnits
  Points to a KFbxSystemUnit array to store the predefined system units. The array size is KFbxSystemUnit_sPredefinedUnitCount.
static const
KFbxUnitConversionOptions 
DefaultConversionOptions
  Stores the default conversion options.

Protected Member Functions

void  ApplyMultiplier (KFbxNode *pRoot, bool pSubChildrenOnly) const
void  ConvertSTProperties (KArrayTemplate< KFbxNode * > &pNodes, double pConversionFactor) const
void  ConvertSProperty (KArrayTemplate< KFbxNode * > &pNodes, double pConversionFactor) const
void  ConvertAnimCurveNode (KArrayTemplate< KFbxAnimCurveNode * > &pFCurves, double pConversionFactor) const
double  GetConversionFactor (double pTargetScaleFactor, double pSourceScaleFactor) const
void  AdjustPivots (KFbxNode *pNode, double pConversionFactor, KFbxXMatrix &pOriginalGlobalM) const
void  AdjustLimits (KFbxNode *pNode, double pConversionFactor) const
void  AdjustPoses (KFbxScene *pScene, double pConversionFactor) const
void  AdjustCluster (KFbxNode *pNode, double pConversionFactor) const
void  AdjustLightIntensity (KFbxNode *pNode, const double pConversionFactor) const
void  AdjustPhotometricLightProperties (KFbxNode *pNode, const double pConversionFactor) const
void  AdjustCameraClipPlanes (KFbxNode *pNode, const double pConversionFactor) const
void  ConvertChildren (KFbxNode *pRoot, const KFbxSystemUnit &pSrcUnit, bool pSubChildrenOnly, const KFbxUnitConversionOptions &pOptions) const

Protected Attributes

double  mScaleFactor
double  mMultiplier

Friends

class  KFbxGlobalSettings

Classes

struct   KFbxUnitConversionOptions
  Struct to define various options that you can use to convert the system unit of a scene. More...

Constructor & Destructor Documentation

KFbxSystemUnit ( double  pScaleFactor,
double  pMultiplier = 1.0  
)

Constructor.

Parameters:
pScaleFactor  The equivalent number of centimeters in the new system unit. For example, an inch unit uses a scale factor of 2.54.
pMultiplier  A multiplier factor of pScaleFactor.

~KFbxSystemUnit (  ) 

Destructor.


Member Function Documentation

void ConvertScene ( KFbxScene pScene,
const KFbxUnitConversionOptions pOptions = DefaultConversionOptions  
) const

Converts a scene from its system units to this system unit.

Parameters:
pScene  The scene to convert.
pOptions  Conversion options, see:KFbxSystemUnit:: KFbxUnitConversionOptions.

void ConvertChildren ( KFbxNode pRoot,
const KFbxSystemUnit pSrcUnit,
const KFbxUnitConversionOptions pOptions = DefaultConversionOptions  
) const

Converts the child (or children) of the given node from the system unit to this system unit.

Unlike the ConvertScene() method, this method does not set the axis system of the scene to which the pRoot node belongs. It also does not adjust KFbxPoses as they are not stored under the scene, and not under a particular node.

Parameters:
pRoot  The given node.
pSrcUnit  The source system unit.
pOptions  Conversion options, see:KFbxSystemUnit:: KFbxUnitConversionOptions.

void ConvertScene ( KFbxScene pScene,
KFbxNode pFbxRoot,
const KFbxUnitConversionOptions pOptions = DefaultConversionOptions  
) const

Converts a scene from its system unit to this system unit, using the specified Fbx_Root node.

This method is provided for backwards compatibility only and instead you should use ConvertScene( KFbxScene* , const KFbxUnitConversionOptions& ) whenever possible.

Parameters:
pScene  The scene to convert.
pFbxRoot  The Fbx_Root node to use for conversion.
pOptions  Conversion options, see:KFbxSystemUnit:: KFbxUnitConversionOptions

double GetScaleFactor (  )  const

Returns the system unit's scale factor, relative to centimeters.

This factor scales system unit values to centimeters. If you want to scale values to centimeters, use this value. Ignore the "multiplier" (returned by GetMultiplier()) value.

Returns:
The the system unit's scale factor, relative to centimeters.

KString GetScaleFactorAsString ( bool  pAbbreviated = true  )  const

Returns a unit label for the current scale factor.

Parameters:
pAbbreviated  If true, returns abbreviated string.
Returns:
The unit label for the current scale factor.

KString GetScaleFactorAsString_Plurial (  )  const

Returns a unit label for the current scale factor.

The first letter of the label is in upper case and the label should be pluralized.

Returns:
The unit label for the current scale factor.

double GetMultiplier (  )  const

Returns the multiplier factor of the system unit.

bool operator== ( const KFbxSystemUnit pOther  )  const

Equivalence operator.

Parameters:
pOther  Another system unit compared with this system unit.
Returns:
True if equal, false otherwise.

bool operator!= ( const KFbxSystemUnit pOther  )  const

Non-equivalence operator.

Parameters:
pOther  Another system unit compared with this system unit.
Returns:
True if unequal, false otherwise.

double GetConversionFactorTo ( const KFbxSystemUnit pTarget  )  const

Returns the conversion factor from this system unit to the target system unit, excluding the multiplier factor.

Parameters:
pTarget  The target system unit.

double GetConversionFactorFrom ( const KFbxSystemUnit pSource  )  const

Returns the conversion factor from the source system unit to this system unit, excluding the multiplier factor.

Parameters:
pSource  The source system unit.

void ApplyMultiplier ( KFbxNode pRoot,
bool  pSubChildrenOnly  
) const [protected]

void ConvertSTProperties ( KArrayTemplate< KFbxNode * > &  pNodes,
double  pConversionFactor  
) const [protected]

void ConvertSProperty ( KArrayTemplate< KFbxNode * > &  pNodes,
double  pConversionFactor  
) const [protected]

void ConvertAnimCurveNode ( KArrayTemplate< KFbxAnimCurveNode * > &  pFCurves,
double  pConversionFactor  
) const [protected]

double GetConversionFactor ( double  pTargetScaleFactor,
double  pSourceScaleFactor  
) const [protected]

void AdjustPivots ( KFbxNode pNode,
double  pConversionFactor,
KFbxXMatrix pOriginalGlobalM  
) const [protected]

void AdjustLimits ( KFbxNode pNode,
double  pConversionFactor  
) const [protected]

void AdjustPoses ( KFbxScene pScene,
double  pConversionFactor  
) const [protected]

void AdjustCluster ( KFbxNode pNode,
double  pConversionFactor  
) const [protected]

void AdjustLightIntensity ( KFbxNode pNode,
const double  pConversionFactor  
) const [protected]

void AdjustPhotometricLightProperties ( KFbxNode pNode,
const double  pConversionFactor  
) const [protected]

void AdjustCameraClipPlanes ( KFbxNode pNode,
const double  pConversionFactor  
) const [protected]

void ConvertChildren ( KFbxNode pRoot,
const KFbxSystemUnit pSrcUnit,
bool  pSubChildrenOnly,
const KFbxUnitConversionOptions pOptions  
) const [protected]

Friends And Related Function Documentation

friend class KFbxGlobalSettings [friend]

Definition at line 239 of file kfbxsystemunit.h.


Member Data Documentation

const KFbxSystemUnit mm [static]

Predefined system unit for millimeters.

Definition at line 106 of file kfbxsystemunit.h.

const KFbxSystemUnit dm [static]

Predefined system unit for decimeters.

Definition at line 109 of file kfbxsystemunit.h.

const KFbxSystemUnit cm [static]

Predefined system unit for centimeters.

Definition at line 112 of file kfbxsystemunit.h.

const KFbxSystemUnit m [static]

Predefined system unit for meters.

Definition at line 115 of file kfbxsystemunit.h.

const KFbxSystemUnit km [static]

Predefined system unit for kilometers.

Definition at line 118 of file kfbxsystemunit.h.

const KFbxSystemUnit Inch [static]

Predefined system unit for inches.

Definition at line 121 of file kfbxsystemunit.h.

Referenced by fbxDistance::internalValue().

const KFbxSystemUnit Foot [static]

Predefined system unit for feet.

Definition at line 124 of file kfbxsystemunit.h.

const KFbxSystemUnit Mile [static]

Predefined system unit for miles.

Definition at line 127 of file kfbxsystemunit.h.

const KFbxSystemUnit Yard [static]

Predefined system unit for yards.

Definition at line 130 of file kfbxsystemunit.h.

Points to a KFbxSystemUnit array to store the predefined system units. The array size is KFbxSystemUnit_sPredefinedUnitCount.

Definition at line 135 of file kfbxsystemunit.h.

Stores the default conversion options.

Definition at line 138 of file kfbxsystemunit.h.

double mScaleFactor [protected]

Definition at line 220 of file kfbxsystemunit.h.

double mMultiplier [protected]

Definition at line 221 of file kfbxsystemunit.h.

KFbxSystemUnit KFbxSystemUnit KFbxSystemUnit KFbxSystemUnit KFbxSystemUnit KFbxSystemUnit KFbxSystemUnit KFbxSystemUnit KFbxSystemUnit KFbxSystemUnit
KFbxSystemUnit KFbxSystemUnit KFbxSystemUnit KFbxSystemUnit KFbxSystemUnit KFbxSystemUnit KFbxSystemUnit KFbxSystemUnit KFbxSystemUnit KFbxSystemUnit